package com.sys.db.daoImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sys.db.dao.DefJobTypeDao;
import com.sys.pojo.DefJobType;

public class DefJobTypeDaoImpl extends SqlMapClientDaoSupport implements DefJobTypeDao {

	public void delete(int id) throws Exception {
		
		this.getSqlMapClientTemplate().delete("DefJobType.delete",id);
	}

	public List findAll() throws Exception {
		List list=this.getSqlMapClientTemplate().queryForList("DefJobType.findAll");
		return list;
	}
	public List findByPage(int start,int limit) throws Exception {
		
		Map map=new HashMap<String,Integer>();
		map.put("start", start);
		map.put("end", start+limit);
		List list=this.getSqlMapClientTemplate().queryForList("DefJobType.findByPage",map);
		return list;
	}
	public DefJobType findById(int id) throws Exception {
		
		DefJobType d=(DefJobType) this.getSqlMapClientTemplate().queryForObject("DefJobType.findById",id);
		return d;
	}

	public void save(DefJobType defJobType) throws Exception {
		
		this.getSqlMapClientTemplate().insert("DefJobType.insert",defJobType);
	}

	public void update(DefJobType defJobType) throws Exception {
		
		this.getSqlMapClientTemplate().update("DefJobType.update",defJobType);
	}

	

}
